package com.boot.springBoot.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Mono;

import javax.jws.HandlerChain;

/**
 * 新一代Web MVC框架  响应式的  试一下  WebFlux示例代码
 * @author ysp
 */
@RestController
public class WebFluxController {

    private final Logger logger = LoggerFactory.getLogger(this.getClass());

    @GetMapping("/hellow")
    public Mono<String> hellow(){
        logger.info("WebFlux");
       return Mono.just("你好时间！");
    }

    @RequestMapping(value = "/hellow2",method = RequestMethod.GET)
    public String hellow2(){
        logger.info("原始方式");
        return "你好时间！";
    }

}
